import { Result } from "@/api/result"
import { http } from "@/api"
import { UserApi } from "./types/url"
import { LoginRes,VerifyRes } from "./types/res"
import { RegisterData,LoginData } from "./types/data"

//登录
export function login(data: LoginData) {
    return http.post<LoginRes>(UserApi.LOGIN_URL, data)
}

//注册
export function register(data: RegisterData) {
    return http.post<LoginRes>(UserApi.REGISTER_URL, data)
}

//获取验证码
export function getValidCode() {
    return http.get<VerifyRes>(UserApi.VERIFY_URL)
}